Vizard 7 » Command Index » Vizard modules » vizact » <vizact>.method.[name]
7.6

<vizact>.method.[name]

Create an action to call an arbitrary method with specified arguments

<vizact>.method.[name](  
*args  
**kw  
)  
*args
Arguments to pass to the function
**kw
Keyword arguments to pass to the function

Remarks

The vizact.method interface allows creating actions to call any method of an object as an action. Simply replace [name] with the name of the method to call along with the arguments to pass.

This action supports <vizact>.mix parameters. When mix parameters are used, the specified function will be called until the mix parameter completes. This is useful for animating arbitrary commands.

Return Value

An action that can be applied to any <node3d> object

Example

Example 1:
# Toggle visibility every 0.5 seconds
ToggleVisible = vizact.sequence( [vizact.waittime(0.5), vizact.method.visible(viz.TOGGLE)], viz.FOREVER)
node.addAction(ToggleVisible)


Example 2:
import viz
import vizact
viz.go()

# Add 3D text
text = viz.addText3D('WorldViz',pos=(0,1.5,6),color=viz.ORANGE)
text.alignment(viz.ALIGN_CENTER)

# Add spinning action on pool 1
text.addAction( vizact.spin(0,1,0,20), pool=1 )

# Create actions to animate thickness
thick = vizact.method.setThickness( vizact.mix(0.1, 1.0, time=1.0) )
thin = vizact.method.setThickness( vizact.mix(1.0, 0.1, time=1.0) )

# Cycle thick/thin actions on pool 2
text.addAction( vizact.sequence( thick, thin, viz.FOREVER ), pool = 2 )

See also

<vizact>.mix
<vizact>.call
<viztask>.waitCall